package comCS275.note_share;

import android.os.Bundle;
import android.view.View.OnClickListener;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

public class LogInPage extends Activity implements OnClickListener {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_log_in_page);
		Button btnLogin = (Button)this.findViewById(R.id.login_button);
		btnLogin.setOnClickListener(this);
		TextView newAccount = (TextView)this.findViewById(R.id.txtLogin);
		newAccount.setOnClickListener(this);
	}

	public void onClick(View v){
		switch(v.getId()){
			case R.id.login_button:
				EditText userid = (EditText) findViewById(R.id.username);
				EditText password = (EditText) findViewById(R.id.password);
				String usr =  userid.getText().toString();
				String pass = password.getText().toString();
				Intent i = new Intent(LogInPage.this, MenuPage.class);
				startActivity(i);
			break;
			case R.id.txtLogin:
				Intent j = new Intent(LogInPage.this, AccountCreationPage.class);
				startActivity(j);
			break;
		}
		
	}
	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.log_in_page, menu);
		return true;
	}

}
